/* eslint-disable require-await */
module.exports = async (ctx) => {
  if (ctx.isAuthenticated()) {
    const {
      username,
      email
    } = ctx.session.passport.user
    ctx.body = {
      username,
      email
    }
  } else {
    ctx.body = {
      username: '',
      email: ''
    }
  }
}
